import service from '@/utils/request';

const BusinessApi = {
  // ----------------商户管理-----------------
  listBusiness: function (data) {
    return service.get('business/page', { params: data });
  },
  addBusiness: function (data) {
    return service.post('business', data);
  },
  editBusiness: function (data) {
    return service.put('business', data);
  },
  updateBusinessState: function (data) {
    return service.put('business/updateBusinessState', data);
  },
  deleteBusiness: function (data) {
    return service.put('business/delete', data);
  },
  getBusinessInfo(data) {
    return service.get('business', { params: data });
  },
  listIdNameVo(data) {
    return service.get('business/listIdNameVo', { params: data });
  },
  // 通过服务分类的id获取所有的商户(不是分页获取)
  listIdName(data) {
    return service.get('business/listIdName', { params: data });
  },
  // 获取可线下月结所有商户列表
  listRelationBusiness(data) {
    return service.get('businessPBusiness/listRelationBusiness', { params: data });
  },
  batchRelationBusiness(data) {
    return service.post('businessPBusiness/batchSetRelation', data);
  },
  getBusinessWeight(data) {
    return service.get('business/getBusinessWeight', { params: data });
  },
  setBusinessWeight(data) {
    return service.put('business/setBusinessWeight', data);
  },
  setBusinessState(data) {
    return service.put('business/setBusinessState', data);
  },
  openBusiness(data) {
    return service.put('business/openBusiness', data);
  },
  exportSetInfo(data) {
    return service.get('business/exportSet', { params: data, responseType: 'blob' });
  },
  updateImportSetInfo(data) {
    return service.put('business/updateImportSet', data);
  },
  getBusinessAccount(data) {
    return service.get('manager/listDataByBusiness', { params: data });
  },
  setPortionInfo(data) {
    return service.put('business/setPortionInfo', data);
  },
  checkoutPrinter(data) {
    return service.get('business/checkoutPrinter', { params: data });
  },
  listRelationData(data) {
    return service.get('businessPWaiter/listRelationData', { params: data });
  },
  batchSetRelation(data) {
    return service.post('businessPWaiter/batchSetRelation', data);
  },
  listBankCode(data) {
    return service.get('bankCode/listBankCode', { params: data });
  },
  listBranchCode(data) {
    return service.get('bankCode/listBranchCode', { params: data });
  },
  pageBranchCode(data) {
    return service.get('bankCode/pageBranchCode', { params: data });
  },
  listOrderVerify(data) {
    return service.get('orderVerify/page', { params: data });
  },
  batchAddMember(data) {
    return service.post('member/batchAddMember', data);
  },
  setDiscount(data) {
    return service.put('business/setBusinessData', data);
  },
  lesseeList(data) {
    return service.get('sysTenant/listIdName', { params: data });
  },
  setSharingInfo(data) {
    return service.put('business/setSharingInfo', data);
  },
  isNameRepeat(data) {
    return service.post('businessServer/serverCheckoutName', data);
  },
};

export default BusinessApi;
